﻿Imports VN.INS.DL.DH
Imports VN.INS.BL.BE

Public Class FinancieroDA

    Public Function carga_grillafinanciero(ByVal strPoa As String, ByVal strPeriodo As String, ByVal strVersion As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim strCadAuxi As String
        Dim strCadAuxiEspecial As String

        Try
            If strPeriodo = "201306" Then
                strCadAuxi = " NVL2(EJEC_EN_EL_MES,EJEC_EN_EL_MES, '') "

                strCadAuxiEspecial = "  (CASE WHEN TO_NUMBER(PERIODO.MES) >= 1 THEN NVL(META_01,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 2 THEN NVL(META_02,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 3 THEN NVL(META_03,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 4 THEN NVL(META_04,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 5 THEN NVL(META_05,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 6 THEN NVL(META_06,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 7 THEN NVL(META_07,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 8 THEN NVL(META_08,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 9 THEN NVL(META_09,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 10 THEN NVL(META_10,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 11 THEN NVL(META_11,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 12 THEN NVL(META_12,0) ELSE 0 END " + _
                                       "  )  "

            Else
                strCadAuxi = " NVL(OBT_FINAN_ACUM_MES_ANT(PTP.POA, PERIODO.PERIODO ,POA_FINANCIERA_HISTORICO.ID_POA_ACTIVIDAD_FINANCIERA, '" + strVersion + "'),0) "

                If strPeriodo = "201401" Then
                    strCadAuxiEspecial = " ( NVL(META_01,0) + NVL(META_02,0) + NVL(META_03,0) + NVL(META_04,0) + NVL(META_05,0) + NVL(META_06,0) + NVL(META_07,0) + NVL(META_08,0) + NVL(META_09,0) + NVL(META_10,0) + NVL(META_11,0) + NVL(META_12,0) ) "
                Else

                    strCadAuxiEspecial = "  (CASE WHEN TO_NUMBER(PERIODO.MES) >= 1 THEN NVL(META_01,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 2 THEN NVL(META_02,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 3 THEN NVL(META_03,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 4 THEN NVL(META_04,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 5 THEN NVL(META_05,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 6 THEN NVL(META_06,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 7 THEN NVL(META_07,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 8 THEN NVL(META_08,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 9 THEN NVL(META_09,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 10 THEN NVL(META_10,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 11 THEN NVL(META_11,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 12 THEN NVL(META_12,0) ELSE 0 END " + _
                                           "  )  "
                End If

            End If

            lxc_SQL = "SELECT FINP.ID_POA_FINACIERO_PERSONA,PTP.ID_PLAN_TRABAJO_POA, POA_FINANCIERA_HISTORICO.ID_POA_ACTIVIDAD_FINANCIERA, " + _
                     " PERIODO.DESCRIPCION AS PERIODO, PERIODO.MES, PERIODO.ANHIO, FINP.ESTADO, " + strCadAuxi + " EJEC_EN_EL_MES, " + _
                     " FINP.FECHA_VISITA1, FINP.FECHA_VISITA2, FINP.FECHA_VISITA3, FINP.FECHA_VISITA4, FINP.OBSERVACIONES, " + _
                     " (case when FINP.META_MENSUAL1 is null then 0 else FINP.META_MENSUAL1  end) AS  META_MENSUAL1 , " + _
                     "(case when FINP.META_MENSUAL2 is null then 0 else FINP.META_MENSUAL2  end) AS  META_MENSUAL2 , " + _
                     "(case when FINP.META_MENSUAL3 is null then 0 else FINP.META_MENSUAL3  end) AS  META_MENSUAL3 , " + _
                     "(case when FINP.META_MENSUAL4 is null then 0 else FINP.META_MENSUAL4  end) AS  META_MENSUAL4 , " + _
                     " (NVL(META_01, 0) +  NVL(META_02, 0) + NVL(META_03, 0) + NVL(META_04, 0) + NVL(META_05, 0) + NVL(META_06, 0) +" + _
                     "  NVL(META_07, 0)  + NVL(META_08, 0) + NVL(META_09, 0) + NVL(META_10, 0) + NVL(META_11, 0) + NVL(META_12,0)) AS META_ANUAL, " + _
                     " CASE MES " + _
                     " WHEN '01' THEN META_01 " + _
                     " WHEN '02' THEN META_02 " + _
                     " WHEN '03' THEN META_03 " + _
                     " WHEN '04' THEN META_04 " + _
                     " WHEN '05' THEN META_05 " + _
                     " WHEN '06' THEN META_06 " + _
                     " WHEN '07' THEN META_07 " + _
                     " WHEN '08' THEN META_08 " + _
                     " WHEN '09' THEN META_09 " + _
                     " WHEN '10' THEN META_10 " + _
                     " WHEN '11' THEN META_11 " + _
                     " WHEN '12' THEN META_12 " + _
                     " END AS MES1  " + _
                     " ," + strCadAuxiEspecial + " AS ACUMULADO " + _
                     ",ESPECIFICA_GASTO.DESCRIPCION, ESPECIFICA_GASTO.ESPECIFICA_GASTO AS GENERICA   " + _
                     " FROM POA_FINANCIERA_HISTORICO INNER JOIN ESPECIFICA_GASTO ON POA_FINANCIERA_HISTORICO.GENERICA_GASTO = ESPECIFICA_GASTO.GENERICA_GASTO AND  " + _
                     " POA_FINANCIERA_HISTORICO.ESPECIFICA_GASTO = ESPECIFICA_GASTO.ESPECIFICA_GASTO " + _
                     " INNER JOIN  GENERICA_GASTOS ON ESPECIFICA_GASTO.GENERICA_GASTO = GENERICA_GASTOS.GENERICA_GASTOS " + _
                     " INNER JOIN PLAN_TRABAJO_POA PTP ON PTP.POA = POA_FINANCIERA_HISTORICO.POA " + _
                     " INNER JOIN PLAN_TRABAJO_PERSONA ON PTP.ID_PLAN_TRABAJO_PERSONA = PLAN_TRABAJO_PERSONA.ID_PLAN_TRABAJO_PERSONA " + _
                     " INNER JOIN PERIODO ON PLAN_TRABAJO_PERSONA.PERIODO = PERIODO.PERIODO " + _
                     " LEFT JOIN POA_FINANCIERO_PERSONA FINP ON FINP.ID_PLAN_TRABAJO_POA = PTP.ID_PLAN_TRABAJO_POA " + _
                     " WHERE PTP.POA ='" + strPoa + "' AND " + _
                            "PLAN_TRABAJO_PERSONA.PERIODO = '" + strPeriodo + "' AND " + _
                            "POA_FINANCIERA_HISTORICO.VERSION = '" + strVersion + "' " + _
                    "ORDER BY ESPECIFICA_GASTO.ESPECIFICA_GASTO"

            '" order by FINP.ID_POA_FINACIERO_PERSONA ,POA_FINANCIERA_HISTORICO.ID_POA_ACTIVIDAD_FINANCIERA "

            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw
        End Try
    End Function

    Public Function carga_financiero_ed(ByVal strPoa As String, ByVal strPeriodo As String, ByVal strVersion As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim strCadAuxi As String
        Dim strCadAuxiEspecial As String

        Try

            If strPeriodo = "201306" Then
                strCadAuxi = " NVL2(EJEC_EN_EL_MES,EJEC_EN_EL_MES, '') "

                strCadAuxiEspecial = "  (CASE WHEN TO_NUMBER(PERIODO.MES) >= 1 THEN NVL(META_01,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 2 THEN NVL(META_02,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 3 THEN NVL(META_03,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 4 THEN NVL(META_04,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 5 THEN NVL(META_05,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 6 THEN NVL(META_06,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 7 THEN NVL(META_07,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 8 THEN NVL(META_08,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 9 THEN NVL(META_09,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 10 THEN NVL(META_10,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 11 THEN NVL(META_11,0) ELSE 0 END + " + _
                                        " CASE WHEN TO_NUMBER(PERIODO.MES) >= 12 THEN NVL(META_12,0) ELSE 0 END " + _
                                       "  )  "
            Else
                strCadAuxi = " NVL(OBT_FINAN_ACUM_MES_ANT(PLAN_TRABAJO_POA.POA, PERIODO.PERIODO ,POA_FINANCIERA_HISTORICO.ID_POA_ACTIVIDAD_FINANCIERA, '" + strVersion + "'),0) "

                If strPeriodo = "201401" Then
                    strCadAuxiEspecial = " ( NVL(META_01,0) + NVL(META_02,0) + NVL(META_03,0) + NVL(META_04,0) + NVL(META_05,0) + NVL(META_06,0) + NVL(META_07,0) + NVL(META_08,0) + NVL(META_09,0) + NVL(META_10,0) + NVL(META_11,0) + NVL(META_12,0) ) "
                Else
                    strCadAuxiEspecial = "  (CASE WHEN TO_NUMBER(PERIODO.MES) >= 1 THEN NVL(META_01,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 2 THEN NVL(META_02,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 3 THEN NVL(META_03,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 4 THEN NVL(META_04,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 5 THEN NVL(META_05,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 6 THEN NVL(META_06,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 7 THEN NVL(META_07,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 8 THEN NVL(META_08,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 9 THEN NVL(META_09,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 10 THEN NVL(META_10,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 11 THEN NVL(META_11,0) ELSE 0 END + " + _
                                            " CASE WHEN TO_NUMBER(PERIODO.MES) >= 12 THEN NVL(META_12,0) ELSE 0 END " + _
                                           "  )  "
                End If
            End If

            lxc_SQL = " SELECT PERIODO.MES,PERIODO.DESCRIPCION AS PERIODO ,POA_FINANCIERO_PERSONA.ESTADO,PERIODO.ANHIO,POA_FINANCIERO_PERSONA.OBSERVACIONES, " + _
                     " POA_FINANCIERO_PERSONA.FECHA_VISITA1,POA_FINANCIERO_PERSONA.FECHA_VISITA2,POA_FINANCIERO_PERSONA.FECHA_VISITA3,POA_FINANCIERO_PERSONA.FECHA_VISITA4, " + _
                     " POA_FINANCIERO_PERSONA.ID_PLAN_TRABAJO_POA,POA_FINANCIERO_PERSONA.ID_POA_ACTIVIDAD_FINANCIERA , ID_POA_FINACIERO_PERSONA, " + strCadAuxi + " EJEC_EN_EL_MES,  " + _
                     " (case when POA_FINANCIERO_PERSONA.META_MENSUAL1 = 0 then POA_FINANCIERO_PERSONA.META_MENSUAL1 else POA_FINANCIERO_PERSONA.META_MENSUAL1 end) AS  META_MENSUAL1 , " + _
                     " (case when POA_FINANCIERO_PERSONA.META_MENSUAL2 = 0 then POA_FINANCIERO_PERSONA.META_MENSUAL2 else POA_FINANCIERO_PERSONA.META_MENSUAL2 end) AS  META_MENSUAL2 , " + _
                     " (case when POA_FINANCIERO_PERSONA.META_MENSUAL3 = 0 then POA_FINANCIERO_PERSONA.META_MENSUAL3 else POA_FINANCIERO_PERSONA.META_MENSUAL3 end) AS  META_MENSUAL3 , " + _
                     " (case when POA_FINANCIERO_PERSONA.META_MENSUAL4 = 0 then POA_FINANCIERO_PERSONA.META_MENSUAL4 else POA_FINANCIERO_PERSONA.META_MENSUAL4 end) AS  META_MENSUAL4 , " + _
                     " (NVL(META_01, 0) +  NVL(META_02, 0) + NVL(META_03, 0) + NVL(META_04, 0) + NVL(META_05, 0) + NVL(META_06, 0) +" + _
                     "  NVL(META_07, 0)  + NVL(META_08, 0) + NVL(META_09, 0) + NVL(META_10, 0) + NVL(META_11, 0) + NVL(META_12,0)) AS META_ANUAL, " + _
                     " CASE MES " + _
                     " WHEN '01' THEN META_01 " + _
                     " WHEN '02' THEN META_02 " + _
                     " WHEN '03' THEN META_03 " + _
                     " WHEN '04' THEN META_04 " + _
                     " WHEN '05' THEN META_05 " + _
                     " WHEN '06' THEN META_06 " + _
                     " WHEN '07' THEN META_07 " + _
                     " WHEN '08' THEN META_08 " + _
                     " WHEN '09' THEN META_09 " + _
                     " WHEN '10' THEN META_10 " + _
                     " WHEN '11' THEN META_11 " + _
                     " WHEN '12' THEN META_12 " + _
                     " END AS MES1  " + _
                     " , " + strCadAuxiEspecial + " AS ACUMULADO, " + _
                     " ESPECIFICA_GASTO.DESCRIPCION,POA_FINANCIERO_PERSONA.FECHA_VISITA1 AS F1,POA_FINANCIERO_PERSONA.FECHA_VISITA2 AS F2, " + _
                     " POA_FINANCIERO_PERSONA.FECHA_VISITA3 AS F3,POA_FINANCIERO_PERSONA.FECHA_VISITA4 AS F4 ,  " + _
                     " ESPECIFICA_GASTO.ESPECIFICA_GASTO AS GENERICA  " + _
                     " FROM POA_FINANCIERA_HISTORICO " + _
                     " left JOIN  PLAN_TRABAJO_POA ON PLAN_TRABAJO_POA.POA = POA_FINANCIERA_HISTORICO.POA  " + _
                     " left JOIN PLAN_TRABAJO_PERSONA ON PLAN_TRABAJO_POA.ID_PLAN_TRABAJO_PERSONA = PLAN_TRABAJO_PERSONA.ID_PLAN_TRABAJO_PERSONA " + _
                     " left JOIN PERIODO ON PLAN_TRABAJO_PERSONA.PERIODO = PERIODO.PERIODO " + _
                     " left JOIN ESPECIFICA_GASTO ON POA_FINANCIERA_HISTORICO.GENERICA_GASTO = ESPECIFICA_GASTO.GENERICA_GASTO " + _
                     "           AND POA_FINANCIERA_HISTORICO.ESPECIFICA_GASTO = ESPECIFICA_GASTO.ESPECIFICA_GASTO " + _
                     " left JOIN GENERICA_GASTOS ON ESPECIFICA_GASTO.GENERICA_GASTO = GENERICA_GASTOS.GENERICA_GASTOS  " + _
                     " left JOIN POA_FINANCIERO_PERSONA ON POA_FINANCIERO_PERSONA.ID_POA_ACTIVIDAD_FINANCIERA = POA_FINANCIERA_HISTORICO.ID_POA_ACTIVIDAD_FINANCIERA   " + _
                     " AND POA_FINANCIERO_PERSONA.ID_PLAN_TRABAJO_POA = PLAN_TRABAJO_POA.ID_PLAN_TRABAJO_POA " + _
                     " WHERE POA_FINANCIERA_HISTORICO.POA = '" + strPoa + "' AND " + _
                            "POA_FINANCIERA_HISTORICO.VERSION = '" + strVersion + "' AND " + _
                            "POA_FINANCIERO_PERSONA.VERSION = '" + strVersion + "' "

            If strPeriodo <> "all" Then
                lxc_SQL = lxc_SQL & " AND  PERIODO.PERIODO ='" & strPeriodo & "' "
            Else
                lxc_SQL = lxc_SQL & " AND PERIODO.MES = (select to_char(sysdate,'MM') from dual)"
            End If
            'lxc_SQL = lxc_SQL & " ORDER BY ID_POA_FINACIERO_PERSONA "
            lxc_SQL = lxc_SQL & " ORDER BY ESPECIFICA_GASTO.ESPECIFICA_GASTO "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw
        End Try
    End Function

    Public Sub insertar_financiero_per(ByVal IDPLAN As String, ByVal IDPOACT As String,
                                ByVal IDFPER As String, ByVal EJEC_M As String, ByVal MTM1 As String, ByVal MTM2 As String,
                                ByVal MTM3 As String, ByVal MTM4 As String, ByVal OB As String, ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As String, ByVal E As String,
                                ByVal TV1 As String, ByVal TV2 As String, ByVal TV3 As String, ByVal TV4 As String, ByVal strVersion As String)
        Dim objData As AdministradorOracle = New AdministradorOracle
        Try
            objData.CreateInputOracle("IDPOACT", IDPOACT, 20)
            objData.CreateInputOracle("IDPLAN", IDPLAN, 20)
            objData.CreateInputOracle("IDFPER", IDFPER, 20)
            objData.CreateInputOracle("EJEC_M", EJEC_M, 20)
            objData.CreateInputOracle("F1", F1, 20)
            objData.CreateInputOracle("F2", F2, 20)
            objData.CreateInputOracle("F3", F3, 20)
            objData.CreateInputOracle("F4", F4, 20)
            objData.CreateInputOracle("MTM1", CDec(MTM1), 20)
            objData.CreateInputOracle("MTM2", CDec(MTM2), 20)
            objData.CreateInputOracle("MTM3", CDec(MTM3), 20)
            objData.CreateInputOracle("MTM4", CDec(MTM4), 20)
            objData.CreateInputOracle("OB", OB, 2000)
            objData.CreateInputOracle("E", E, 20)
            objData.CreateInputOracle("TV1", CDec(TV1), 20)
            objData.CreateInputOracle("TV2", CDec(TV2), 20)
            objData.CreateInputOracle("TV3", CDec(TV3), 20)
            objData.CreateInputOracle("TV4", CDec(TV4), 20)
            objData.CreateInputOracle("VERSION", strVersion, 1)
            objData.ExecuteOracle_NonQuery("INSERTARFINANCIEROPERSONA", "Conexion.Oracle")
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

    Public Function verifica_accion(ByVal poa As String, ByVal strPeriodo As String) As Integer
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim NUMERO As Integer
        Dim lxc_SQL As String
        Try
            lxc_SQL = " SELECT ID_POA_FINACIERO_PERSONA,META_ANUAL,META_01, " + _
                      " (META_01+ META_03+META_02+ META_03+META_04+META_05+META_06+META_07+META_08+META_09+ " + _
                      " META_10+META_11+META_12) AS ACUMULADO, POA_FINANCIERO_PERSONA.META_MENSUAL1, POA_FINANCIERO_PERSONA.META_MENSUAL2, " + _
                      "  POA_FINANCIERO_PERSONA.META_MENSUAL3, POA_FINANCIERO_PERSONA.META_MENSUAL4 " + _
                      "  FROM POA_ACTIVIDAD_FINANCIERA   INNER JOIN POA_FINANCIERO_PERSONA ON " + _
                      " POA_FINANCIERO_PERSONA.ID_POA_ACTIVIDAD_FINANCIERA = POA_ACTIVIDAD_FINANCIERA.ID_POA_ACTIVIDAD_FINANCIERA   INNER JOIN POA ON " + _
                      " poa.POA = POA_ACTIVIDAD_FINANCIERA.POA " + _
                      "  INNER JOIN PLAN_TRABAJO_POA PTP " + _
                      "  ON PTP.ID_PLAN_TRABAJO_POA = POA_FINANCIERO_PERSONA.ID_PLAN_TRABAJO_POA " + _
                      "  INNER JOIN PLAN_TRABAJO_PERSONA PTE " + _
                      "  ON PTE.ID_PLAN_TRABAJO_PERSONA = PTP.ID_PLAN_TRABAJO_PERSONA " + _
                      " WHERE POA.POA ='" + poa + "' AND PTE.PERIODO = '" + strPeriodo + "' ORDER BY POA_FINANCIERO_PERSONA.ID_POA_FINACIERO_PERSONA "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            NUMERO = objDt.Rows.Count

            Return NUMERO

        Catch ex As Exception
            Throw
        End Try
    End Function

    Public Sub edicion_finaciero(ByVal Ejec_M As String, ByVal V1 As String, ByVal V2 As String, ByVal V3 As String, ByVal V4 As String, ByVal IDPFP As String, ByVal OB As String, ByVal F1 As String, ByVal F2 As String, ByVal F3 As String, ByVal F4 As String, ByVal E As String,
                                ByVal TV1 As String, ByVal TV2 As String, ByVal TV3 As String, ByVal TV4 As String, ByVal strVersion As String)
        Dim objData As AdministradorOracle
        Dim pObjgrilla As String = "EDITARAVANCEFINANCIERO"
        Try
            objData = New AdministradorOracle
            'Reemplazar el valor que dice 4 por el valor real que ocupa en memoria dicha variable
            objData.CreateInputOracle("EJEC_M", Ejec_M, 20)
            objData.CreateInputOracle("V1", V1, 20)
            objData.CreateInputOracle("V2", V2, 20)
            objData.CreateInputOracle("V3", V3, 20)
            objData.CreateInputOracle("V4", V4, 20)
            objData.CreateInputOracle("F1", F1, 20)
            objData.CreateInputOracle("F2", F2, 20)
            objData.CreateInputOracle("F3", F3, 20)
            objData.CreateInputOracle("F4", F4, 20)
            objData.CreateInputOracle("IDPFP", IDPFP, 50)
            objData.CreateInputOracle("OB", OB, 2000)
            objData.CreateInputOracle("E", E, 1)
            objData.CreateInputOracle("TV1", TV1, 20)
            objData.CreateInputOracle("TV2", TV2, 20)
            objData.CreateInputOracle("TV3", TV3, 20)
            objData.CreateInputOracle("TV4", TV4, 20)
            objData.CreateInputOracle("VERSION", strVersion, 1)

            objData.ExecuteOracle_NonQuery("EDITARAVANCEFINANCIERO", "Conexion.Oracle")
        Catch ex As Exception
            Throw ex
        End Try

    End Sub

End Class